package com.zgh.rbac.module;

import com.xxg.base.module.BaseEntity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;


public class Role extends BaseEntity implements Serializable{

	private static final long serialVersionUID = 1L;

	private String roleName;		//角色名称
	private String roleType;		//角色类型，2管理角色，1普通角色
	private String systemName;		//所属系统，1内网还是外网
	private String organization;	//所属组织架构,1业务体系还是2办公体系
	private String status;			//状态，是否启用 1启用，0不启用
	private String deleteStatus;     //删除状态 :0正常1删除
	private long createRoleId;		//创建该角色的角色ID
	private String previouIds;		//前置角色ID，预留
	private String oppositeIds;		//互斥的角色ID,预留
	
	private String powerType;		//角色的数据权限类型：个人，本部门及下属部门，本部门，全部，自定义
	
	private String defaultType;		//默认角色类型 1职工默认角色 2 工作人员默认角色 3 工会法人默认角色  为空则不是默认角色
	
	public String getDefaultType() {
		return defaultType;
	}
	public void setDefaultType(String defaultType) {
		this.defaultType = defaultType;
	}
	//以下数据不存数据库
	private String createRoleName;
	
	//以下内容专为缓存使用
	private List<Long> menuIds=new ArrayList<Long>(); //角色对应的菜单
	private List<Long> userIds=new ArrayList<Long>(); //角色包含的用户
	//用户包含的组织
	private List<OrganizationAndRole> organizationAndRoles=new ArrayList<OrganizationAndRole>();
	
	
	private List<Long> powerUserIds=new ArrayList<Long>();//角色的数据权限-用户
	//角色的数据权限-组织
	private List<RoleAndOrganization> roleAndOrganizations=new ArrayList<RoleAndOrganization>();
	
	
	
	public String getDeleteStatus() {
		return deleteStatus;
	}
	public void setDeleteStatus(String deleteStatus) {
		this.deleteStatus = deleteStatus;
	}
	public List<Long> getPowerUserIds() {
		return powerUserIds;
	}
	public void setPowerUserIds(List<Long> powerUserIds) {
		this.powerUserIds = powerUserIds;
	}
	
	public List<RoleAndOrganization> getRoleAndOrganizations() {
		return roleAndOrganizations;
	}
	public void setRoleAndOrganizations(
			List<RoleAndOrganization> roleAndOrganizations) {
		this.roleAndOrganizations = roleAndOrganizations;
	}
	public List<OrganizationAndRole> getOrganizationAndRoles() {
		return organizationAndRoles;
	}
	public void setOrganizationAndRoles(
			List<OrganizationAndRole> organizationAndRoles) {
		this.organizationAndRoles = organizationAndRoles;
	}
	public List<Long> getUserIds() {
		return userIds;
	}
	public void setUserIds(List<Long> userIds) {
		this.userIds = userIds;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	public String getRoleType() {
		return roleType;
	}
	public void setRoleType(String roleType) {
		this.roleType = roleType;
	}
	public String getSystemName() {
		return systemName;
	}
	public void setSystemName(String systemName) {
		this.systemName = systemName;
	}
	public String getOrganization() {
		return organization;
	}
	public void setOrganization(String organization) {
		this.organization = organization;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public long getCreateRoleId() {
		return createRoleId;
	}
	public void setCreateRoleId(long createRoleId) {
		this.createRoleId = createRoleId;
	}
	public String getPreviouIds() {
		return previouIds;
	}
	public void setPreviouIds(String previouIds) {
		this.previouIds = previouIds;
	}
	public String getOppositeIds() {
		return oppositeIds;
	}
	public void setOppositeIds(String oppositeIds) {
		this.oppositeIds = oppositeIds;
	}
	public String getCreateRoleName() {
		return createRoleName;
	}
	public void setCreateRoleName(String createRoleName) {
		this.createRoleName = createRoleName;
	}
	public String getPowerType() {
		return powerType;
	}
	public void setPowerType(String powerType) {
		this.powerType = powerType;
	}
	
	public boolean equals(Object obj) {
		if(obj==null){
			return false;
		}
		if(obj instanceof Role){
			return  this.getId().equals(((Role) obj).getId());
		}else{
			return false;
		}
	
	}
	public List<Long> getMenuIds() {
		return menuIds;
	}
	public void setMenuIds(List<Long> menuIds) {
		this.menuIds = menuIds;
	}


	@Override
	public String toString() {
		return "Role{" +
				"roleName='" + roleName + '\'' +
				", roleType='" + roleType + '\'' +
				", systemName='" + systemName + '\'' +
				", organization='" + organization + '\'' +
				", status='" + status + '\'' +
				", deleteStatus='" + deleteStatus + '\'' +
				", createRoleId=" + createRoleId +
				", previouIds='" + previouIds + '\'' +
				", oppositeIds='" + oppositeIds + '\'' +
				", powerType='" + powerType + '\'' +
				", defaultType='" + defaultType + '\'' +
				", createRoleName='" + createRoleName + '\'' +
				", menuIds=" + menuIds +
				", userIds=" + userIds +
				", organizationAndRoles=" + organizationAndRoles +
				", powerUserIds=" + powerUserIds +
				", roleAndOrganizations=" + roleAndOrganizations +
				'}';
	}
}
